<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ page language="java" %>
<%@ page import="java.util.*,org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>
<%
    ArrayList nameList = new ArrayList();
    Enumeration e = session.getAttributeNames();
    while(e.hasMoreElements())
      nameList.add(e.nextElement());
    for(int i=0;i<nameList.size();i++)
    {  
      session.removeAttribute((String)nameList.get(i));
    }  
    session.setAttribute("sessionflag","Y");
    String strModuleName = "Base";
    String strApp=(String)request.getParameter("app");
    Integer oApp=(Integer)session.getAttribute("app");
    if(strApp==null && oApp!=null)
      strApp=oApp.toString();
    if(strApp==null)
      strApp="1";
    //System.out.println("App in request is:" + strApp);////////////////////////////
    session.setAttribute("app",new Integer(strApp));
%>
<%
  //response.addHeader("Cache-Control","no-cache");
  response.addHeader("Expires", "0");
  String strLanguageCode = (String)request.getParameter("languagecode");
  if(strLanguageCode == null)
  {
    strLanguageCode = (String)session.getAttribute("languagecode");
    if(strLanguageCode == null)
    { 
      strLanguageCode = "cn";
      session.setAttribute("languagecode",strLanguageCode);
    }
  } 
  else
  {
    session.setAttribute("languagecode",strLanguageCode);
  }    
  OvalLabel label = new OvalLabel(strLanguageCode,strModuleName); 
  OvalCustomMessage message = new OvalCustomMessage(strLanguageCode);
  String contextPath=request.getContextPath();
	Calendar currentdate =Calendar.getInstance();
	int currentyear = currentdate.get(Calendar.YEAR);
  
%>

<html>
<head>
<title>E-manager</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link rel="stylesheet" href="css/cn/csscontent.css" type="text/css">
<script language="JavaScript" src="css/<%= strLanguageCode %>/chinese/script.js"></script>
<script language="JavaScript" src="js/FuncLib.js"></script>
<script language="JavaScript" src="js/cookie.js"></script>
<script language="JavaScript">
function loginCheck(form)
{
 
  if(isEmpty(form.username.value))
  {
	  alert("用户名不能为空！");
   // alert("<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_LoginUser",false)) %>");
    form.username.focus();
    return false;
  }
  if(isEmpty(form.password.value))
  {
	  alert("密码不能为空！");
    //alert("<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_LoginPassword",false)) %>");
    form.password.focus();
    return false;
  }
  if(isEmpty(form.securitycode.value))
  {
	  alert("验证码不能为空！");
    //alert("<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_SecurityCode",false)) %>");
    form.securitycode.focus();
    return false;
  }
  return true;
}
function view_notes(id)
{
  var viewurl = "biee/NotesInfoPop.jsp?<%= OvalTools.randomURL() %>&languagecode=<%= strLanguageCode %>&notesid=" + id;
  popup(viewurl,'newwindow','height=400,width=600,top=100,left=100,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no');
}

function page_login()
{
  if(!loginCheck(leftform))
    return;
  setCookie("oval_username",document.leftform.username.value);
  setCookie("oval_app",document.leftform.app.value);
  setCookie("oval_app",document.leftform.app.value);
  document.leftform.actionname.value = "login";
  isRunning = true;
  document.leftform.submit();
}
function App_Changed()
  {
  
  
  
  
  
  }
function page_inithomepage()
{
	document.leftform.securitycode.value="";
}
</script>
<style type=text/css>div {
	margin: 0px auto
}
body {
	margin: 0px auto
}
.main {
	width: 900px; height: 500px
}
body {
	background-position: center -50px; background-image: url(images/cn/login2.jpg);background-repeat:no-repeat;
}
img {
	border-right: medium none; border-top: medium none; border-left: medium none; border-bottom: medium none
}
.ipt-t-focus {
	background: #fefbbd
}
a.link_bh {
	color: #fff; text-decoration: none
}
a.link_bh:hover {
	font-weight: normal; font-size: 12px; color: #ffcc00; text-decoration: none
}
</style>

  </head>

<body onload="page_inithomepage();" leftmargin=0 topmargin=0 marginheight="0" marginwidth="0">
<table height=500 cellspacing=0 width=900 align=center border=0>
  <tbody>
  <tr>
    <td colspan=3>
      <form style="margin: 0px auto; width: 100%" name=leftform   method=post  action="Dispatcher" target="_self">
      <input type="hidden" name="pagename" value="left">
      <input type=hidden name=actionname>
      <input type="hidden" name="languagecode" value="<%= strLanguageCode %>"/>
       <input type=hidden name=orgcode>
        <input  type=hidden value=value="<%= new Integer(strApp) %>" name=app> 
        <input type=hidden name=mac>
        <iframe style="display: none" name=macfrm src="homepage_files/macaddress.htm"></iframe>
      <div class="main">
      <div style="padding-left: 20px; padding-top: 251px">
      <div  style="font-size: 12px; float: left; width: 615px; color: #fff; line-height: 27px; padding-top: 142px; height: 27px">&nbsp;&nbsp;&nbsp;版权所有(c)以岭药业股份有限公司    copyright ◎ <%=currentyear %> , inc. all rights reserved</div>
      <div style="float: left">
      <div style="padding-bottom: 19px; width: 250px; height: 25px">
      <div  style="font-size: 12px; float: left; width: 50px; line-height: 25px; height: 25px"  align=right>
      <!--<font color=red>lose the label!</font>：--></div>
      <div style="float: left; width: 160px"><input onkeydown="javascript:if(window.event.keyCode == 13)page_login();"  onblur="this.classname='';if(this.value=='') this.value='请输入您的用户名'" style="border-right: medium none; border-top: medium none; background: none transparent scroll repeat 0% 0%; border-left: medium none; width: 120px; border-bottom: medium none"  onfocus="this.classname+=' ipt-t-focus';if(this.value=='请输入您的用户名') this.value=''"  maxlength=50 size=9 value=请输入您的用户名 name="username"></div></div>
      <div style="padding-bottom: 20px; width: 250px; height: 25px">
      <div 
      style="font-size: 12px; float: left; width: 50px; line-height: 25px; height: 25px" 
      align=right>
      <!--<font color=red>lose the label!</font>：--></div>
      <div style="float: left; width: 160px">
      <input onkeydown="javascript:if(window.event.keyCode == 13)page_login();" onblur="this.classname=''" 
      style="border-right: medium none; border-top: medium none; background: none transparent scroll repeat 0% 0%; border-left: medium none; width: 120px; border-bottom: medium none" 
      onfocus="this.classname+=' ipt-t-focus'" type=password maxlength=50 size=9 
      name=password> </div></div>
	  <div style="padding-bottom: 15px; width: 250px; height: 25px">
      <div 
      style="font-size: 12px; float: left; width: 50px; line-height: 25px; height: 25px" 
      align=right>
      <!--<font color=red>lose the label!</font>：--></div>
      <div style="float: left; width: 70px"><input 
     onkeydown="javascript:if(window.event.keyCode == 13)page_login();"
      onblur="this.classname=''" 
      style="border-right: medium none; border-top: medium none; background: none transparent scroll repeat 0% 0%; border-left: medium none; width: 70px; border-bottom: medium none" 
      onfocus="this.classname+=' ipt-t-focus'" type="text"
      name="securitycode"> </div>
      <div style="float: left; width: 50px; height:20px; line-height:20px; background-color:#ccc; margin-left:8px; font-size:12px; text-align: center;">
      <img id="securitycodeobj" width="65" height="20" src="<%=contextPath %>/CreateImage?<%= OvalTools.randomURL() %>"  align="absmiddle" onClick="javascript:this.src='<%=contextPath %>/CreateImage?number='+Math.random()" alt="看不清，请重新获得验证码"/>
	  </div>
      <div style="padding-bottom: 15px; width: 250px; height: 25px">
      <div 
      style="margin-top: 38px; display: inline; float: left; margin-left: 54px"><input style="border-right: 0px; border-top: 0px; background: url(images/cn/btn.jpg); border-left: 0px; width: 67px; cursor: pointer; border-bottom: 0px; height: 28px" onclick="javascript:page_login();" type="button" name="input"> 
      </div></div></div></div></div></form>
       <%
    String strCanRegester=(String)pageContext.getAttribute("canregister");
    if(strCanRegester==null)
        strCanRegester="";
 %>

<script language="JavaScript">
if(getCookie("oval_username") != null)
  leftform.username.value = getCookie("oval_username");

leftform.username.focus();
</script>
      
      </td></tr></tbody></table>

      </body></html>



